<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>

</head>
<body>

<div id="app" @click="stnclick">
  aaaa
<!--  .stop停止事件冒泡-->
  <button @click.stop="btnclick">按钮</button>

<!--  .prevent取消原有事件-->
  <form action="www.baidu.com">
    <input type="submit" value="提交" @click.prevent="btnclick">
  </form>

<!--  .enter 监听键盘 回车触发-->
  <input type="text" @keyup.enter="keyup">

<!--  .once 只触发一次-->
  <button @keydown.once="keydown">确认</button>



</div>

<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el:"#app",
    data: {
      message:"stupid mother fucker"
    },
    methods:{
      btnclick(){
        console.log('btn');
      },
      stnclick()
      {
        console.log('stn');
      },
      keyup(){
        console.log('keyup');
      },
      keydown(){
        console.log('按了确认');
      }
    }
  })
</script>

</body>
</html>